package ronglei.day01.demo05suijilei;
//猜数字

import java.util.Random;
import java.util.Scanner;

public class suijishu02 {
    public static void main(String[] args) {

        Random sr1 = new Random();//随机数
        int num1 = sr1.nextInt(10);//[0=9]
        int num = returnint();//调用方法
        if(num>num1){
            System.out.println("猜大了");
        }else if(num<num1){
            System.out.println("猜小了");
        }else{
            System.out.println("正确");
        }
        System.out.println("正确答案是："+ num1);
    }
    public  static int returnint(){
        Scanner sr = new Scanner(System.in);//键盘事件
        return sr.nextInt();//输入的数字
    }
}
